<?php
header('Content-Type:text/html;Charset=UTF-8');

@$name = $_REQUEST['name'];

@$age = $_REQUEST['age'];

@$contact = $_REQUEST['contact'];

@$address = $_REQUEST['address'];

@$img = $_FILES['img'];

if($img['error']!=0){
	$message="照片上传出错！";
	include "UpdateClient.php";
	die;
}
require 'lib/db.php';

@$flag = dbUpdate("update client set name=:name,age=:age,contact=:contact,address=:address where id=:id",array('name'=>$name,'age'=>$age,'contact'=>$contact,'address'=>$address));

if ($flag==false){
	$message="更新失败！";
	include "UpdateClient.php";
	die;
}

